<template>

  <el-container style="height: 100vh; border: 1px solid #eee">
    <el-aside :width="isSidebarVisible ? '200px' : '0'" style="background-color: #28333E; height: 100vh; margin-left: -1px; transition: width 0.3s">
      <Aside v-if="isSidebarVisible"></Aside>
    </el-aside>

    <el-container style="height: 100%">
      <el-header style="text-align: right; background-color: #23262E; font-size: 12px; height: 60px; border-bottom: darkgray 1px solid">
        <Header @toggle-sidebar="handleToggleSidebar"></Header>
      </el-header>

      <el-main style="height: calc(100% - 60px)">
              <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>

</template>

<script>
import Aside from "@/components/Aside";
import Header from "@/components/Header";
export default {
  name: "Index",
  components: { Header, Aside},
  data() {
    return {
      isSidebarVisible: true
    };
  },
  methods: {
    handleToggleSidebar(visible) {
      this.isSidebarVisible = visible;
    }
  }
}
</script>

<style scoped>

.el-header {
  #background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}
.el-main{
  padding: 5px;
}
.el-aside {
  color: #333;
}

</style>